<?php

// configuration
$url = 'Mission1.php';
$file = 'numbers_of_circle.json';

// check if form has been submitted
if (isset($_POST['text']))
{
    // save the text contents
    file_put_contents($file, $_POST['text']);
    // redirect to form again
    header(sprintf('Location: %s', $url));
    printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
    exit();
}

// read the textfile
$text = file_get_contents($file);

?>
<!-- HTML form -->


<link rel="stylesheet" type="text/css" href="css/style.css">

<h1>Numbers of circles</h1>

<form action="" method="post">
<textarea class="editor font-style" name="text"><?php echo htmlspecialchars($text) ?></textarea>
<input type="submit" class="font-style" />
<input type="button"  class="font-style" onclick="location.href = '../';" value="GO BACK" />
</form>

